{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "from requests_html import HTMLSession"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "200"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "session = HTMLSession()\n",
    "r_one = session.get( 'https://www.nfu.edu.cn/xxyw/index.htm')\n",
    "# 状态码查询\n",
    "r_one.status_code"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "writer = pd.ExcelWriter('out_data.xlsx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>标题</th>\n",
       "      <th>链接</th>\n",
       "      <th>日期</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>我校承办首届 “新时代从商培养工程”</td>\n",
       "      <td>0d7bd841484a42a69d241e79365b6290.htm</td>\n",
       "      <td>2021-04-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>专注当下，冲刺高考，奋斗出最美的青春</td>\n",
       "      <td>f9bcd8092b494a04becfaf48b3138e20.htm</td>\n",
       "      <td>2021-04-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>广东工业大学华立学院来访我校</td>\n",
       "      <td>debb2f222e024cbda5d2644acb6c552c.htm</td>\n",
       "      <td>2021-03-31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>“疫情下的中国、美国以及中美关系”高层论坛暨广州南方学院“美国研究中心”成立五周年纪念研讨会</td>\n",
       "      <td>e5378134dbaf4b7b88d3003f1cd99e59.htm</td>\n",
       "      <td>2021-03-31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>“思想政治理论第一课”上，学校党委书记、校长讲了这些！</td>\n",
       "      <td>7c865b16b203467ab6ddf5569f73e5c1.htm</td>\n",
       "      <td>2021-03-29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>学生报道|传承红色基因，讲好党员故事：我校举办身边优秀党员事迹分享会</td>\n",
       "      <td>28b0ad0eee8149e6b7f4ae65395910ff.htm</td>\n",
       "      <td>2021-03-29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>权威发布：我校名列2021年中国民办高校第四</td>\n",
       "      <td>c48c33c8f744430eb9417b800a8b2e3f.htm</td>\n",
       "      <td>2021-03-26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>喜讯：电气学院学子在国际顶尖期刊发表学术论文</td>\n",
       "      <td>395b8e2ba5df47c59d080d50d1113be1.htm</td>\n",
       "      <td>2021-03-26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>我校召开行政人员专题培训暨2021年春季学期第一次办公室工作例会</td>\n",
       "      <td>59bda093ced440f78c638ade40ab0b93.htm</td>\n",
       "      <td>2021-03-19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>我校开展2021年春季学期教学检查工作</td>\n",
       "      <td>1af5590575b74762b624f048b5ad79f4.htm</td>\n",
       "      <td>2021-03-15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>媒体报道我校入选国家级一流本科专业建设点情况</td>\n",
       "      <td>4e32521de0da4d21979182e1b114a964.htm</td>\n",
       "      <td>2021-03-15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>我校举行转设更名挂牌仪式</td>\n",
       "      <td>23279088871e4b89b8eab2e7fbc77b17.htm</td>\n",
       "      <td>2021-03-12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>广东省教育厅公布国家级一流专业建设点数量排名：我校位列广东高校第29，同类院校第1</td>\n",
       "      <td>a5de3999469447b488857144f58f8c27.htm</td>\n",
       "      <td>2021-03-12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>我校政商研究院学生胡志翔在国际期刊发表论文</td>\n",
       "      <td>6273fd9185b54b20a0af15b9878f1d2c.htm</td>\n",
       "      <td>2021-03-12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>我校举行大一学生升旗仪式暨晨跑之星颁奖大会</td>\n",
       "      <td>a1f9ac1d39704e4d8136478ec97e3635.htm</td>\n",
       "      <td>2021-03-12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>我校召开党史学习教育动员大会</td>\n",
       "      <td>c438a1ec6db5446faf76617654b5ca55.htm</td>\n",
       "      <td>2021-03-11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>我校组织参加全省教育系统党史学习教育动员部署会视频会议</td>\n",
       "      <td>f28729353ff749b9b170825ffe346949.htm</td>\n",
       "      <td>2021-03-09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>喜讯：我校计算机科学与技术专业获IEET认证</td>\n",
       "      <td>f25bba2bf25d43399a88598c769bb779.htm</td>\n",
       "      <td>2021-03-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>我校师生深入学习习近平总书记在政协医药卫生界教育界联组会上的重要讲话精神</td>\n",
       "      <td>d6a77d315f9844618e3449e5e4f08de7.htm</td>\n",
       "      <td>2021-03-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>广东省同类院校唯一：连续两年获批国家级一流专业建设点</td>\n",
       "      <td>96c744528cdf40fc830a4961ef3814dd.htm</td>\n",
       "      <td>2021-03-04</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                标题  \\\n",
       "0                               我校承办首届 “新时代从商培养工程”   \n",
       "1                               专注当下，冲刺高考，奋斗出最美的青春   \n",
       "2                                   广东工业大学华立学院来访我校   \n",
       "3   “疫情下的中国、美国以及中美关系”高层论坛暨广州南方学院“美国研究中心”成立五周年纪念研讨会   \n",
       "4                      “思想政治理论第一课”上，学校党委书记、校长讲了这些！   \n",
       "5               学生报道|传承红色基因，讲好党员故事：我校举办身边优秀党员事迹分享会   \n",
       "6                           权威发布：我校名列2021年中国民办高校第四   \n",
       "7                           喜讯：电气学院学子在国际顶尖期刊发表学术论文   \n",
       "8                 我校召开行政人员专题培训暨2021年春季学期第一次办公室工作例会   \n",
       "9                              我校开展2021年春季学期教学检查工作   \n",
       "10                          媒体报道我校入选国家级一流本科专业建设点情况   \n",
       "11                                    我校举行转设更名挂牌仪式   \n",
       "12       广东省教育厅公布国家级一流专业建设点数量排名：我校位列广东高校第29，同类院校第1   \n",
       "13                           我校政商研究院学生胡志翔在国际期刊发表论文   \n",
       "14                           我校举行大一学生升旗仪式暨晨跑之星颁奖大会   \n",
       "15                                  我校召开党史学习教育动员大会   \n",
       "16                     我校组织参加全省教育系统党史学习教育动员部署会视频会议   \n",
       "17                          喜讯：我校计算机科学与技术专业获IEET认证   \n",
       "18            我校师生深入学习习近平总书记在政协医药卫生界教育界联组会上的重要讲话精神   \n",
       "19                      广东省同类院校唯一：连续两年获批国家级一流专业建设点   \n",
       "\n",
       "                                      链接          日期  \n",
       "0   0d7bd841484a42a69d241e79365b6290.htm  2021-04-02  \n",
       "1   f9bcd8092b494a04becfaf48b3138e20.htm  2021-04-02  \n",
       "2   debb2f222e024cbda5d2644acb6c552c.htm  2021-03-31  \n",
       "3   e5378134dbaf4b7b88d3003f1cd99e59.htm  2021-03-31  \n",
       "4   7c865b16b203467ab6ddf5569f73e5c1.htm  2021-03-29  \n",
       "5   28b0ad0eee8149e6b7f4ae65395910ff.htm  2021-03-29  \n",
       "6   c48c33c8f744430eb9417b800a8b2e3f.htm  2021-03-26  \n",
       "7   395b8e2ba5df47c59d080d50d1113be1.htm  2021-03-26  \n",
       "8   59bda093ced440f78c638ade40ab0b93.htm  2021-03-19  \n",
       "9   1af5590575b74762b624f048b5ad79f4.htm  2021-03-15  \n",
       "10  4e32521de0da4d21979182e1b114a964.htm  2021-03-15  \n",
       "11  23279088871e4b89b8eab2e7fbc77b17.htm  2021-03-12  \n",
       "12  a5de3999469447b488857144f58f8c27.htm  2021-03-12  \n",
       "13  6273fd9185b54b20a0af15b9878f1d2c.htm  2021-03-12  \n",
       "14  a1f9ac1d39704e4d8136478ec97e3635.htm  2021-03-12  \n",
       "15  c438a1ec6db5446faf76617654b5ca55.htm  2021-03-11  \n",
       "16  f28729353ff749b9b170825ffe346949.htm  2021-03-09  \n",
       "17  f25bba2bf25d43399a88598c769bb779.htm  2021-03-08  \n",
       "18  d6a77d315f9844618e3449e5e4f08de7.htm  2021-03-08  \n",
       "19  96c744528cdf40fc830a4961ef3814dd.htm  2021-03-04  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_one = pd.DataFrame( {\n",
    "         \"标题\": r_one.html.xpath('//div[@class=\"news_title\"]/a/@title'),\n",
    "         \"链接\": r_one.html.xpath('//div[@class=\"news_title\"]/a/@href'),\n",
    "         \"日期\": r_one.html.xpath('//font[@class=\"right-more\"]/text()'),\n",
    "     } )\n",
    "df_one"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "200"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "session = HTMLSession()\n",
    "r_two = session.get( 'https://www.nfu.edu.cn/xydt/index.htm')\n",
    "# 状态码查询\n",
    "r_two.status_code"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>标题</th>\n",
       "      <th>链接</th>\n",
       "      <th>日期</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>“远离糖尿病，筑起健康防线” 护理与健康学院寒假社会实践调查成果汇报展示圆满结束</td>\n",
       "      <td>2f3dcc0f4400419e8e42af09fde3c251.htm</td>\n",
       "      <td>2021-03-29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>励能计划2021：你选哪一项？</td>\n",
       "      <td>8b2414ee7cca45d88c4217dd13f8f8ec.htm</td>\n",
       "      <td>2021-04-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>党团同行传薪火，红色循迹筑初心——商学院党团同行重走“东江纵队”红色之路</td>\n",
       "      <td>a9523b72a34e4143afa9b38879ecba0c.htm</td>\n",
       "      <td>2021-04-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>广州南方学院老年与慢病护理研究中心学术沙龙系列第3期圆满结束</td>\n",
       "      <td>f8434c9f092348c2a4a3c1ac8727a8fd.htm</td>\n",
       "      <td>2021-04-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>凝心聚力 共谱新篇——商学院召开新学期全体教职工大会</td>\n",
       "      <td>d60d33983337463390ef99385afce119.htm</td>\n",
       "      <td>2021-04-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>青马工程｜“回首峥嵘岁月，领悟红船精神”——商学院百年党史宣讲活动</td>\n",
       "      <td>4b0c8e69b5074d28badd20cb55436009.htm</td>\n",
       "      <td>2021-04-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>护理与健康学院“教学相长，从教学中成长”暨青年教师专题讲座与交流活动圆满结束</td>\n",
       "      <td>bdda4dfbda944a3eb84612b7045620f4.htm</td>\n",
       "      <td>2021-04-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>党建观摩拓思路，对照标杆“取真经”——我校商学院师生团队赴广东外语外贸大学南国商学院管理学院...</td>\n",
       "      <td>96e05388e3fa43de9a8f446b083875f8.htm</td>\n",
       "      <td>2021-03-30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>护理与健康学院直属党支部2021年春季入党积极分子培训圆满结束</td>\n",
       "      <td>25dc7cb574284be18a6c9a0640e5aca3.htm</td>\n",
       "      <td>2021-03-30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>成长在文传我院举行2021年春季学期全体教职工大会</td>\n",
       "      <td>b9777111c2194e7b85143431ab4706a7.htm</td>\n",
       "      <td>2021-03-29</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>倾心指导促研学，凝心聚力谋发展——大英中心教学研究座谈会顺利召开</td>\n",
       "      <td>c3846031b4c0444a99e0dfd90047c046.htm</td>\n",
       "      <td>2021-03-26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>护理与健康学院第37期师生面对面顺利开展</td>\n",
       "      <td>5e165fdaee834899891ba5b3eea69bc9.htm</td>\n",
       "      <td>2021-03-26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>凝聚共识谋规划， 师生同心促发展—— 电气与计算机工程学院召开全体教职工大会</td>\n",
       "      <td>76d9a219517e4a2b8c28135b51f55e3b.htm</td>\n",
       "      <td>2021-03-25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>护理与健康学院“开卷行之”征文比赛圆满结束</td>\n",
       "      <td>bf6e98d6027544809e35f6f8d5ea5c3a.htm</td>\n",
       "      <td>2021-03-24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>青春心向党，奋进新时代——护理与健康学院院长“思政第一课”顺利开讲</td>\n",
       "      <td>874bf131af7746d888ec1801eb31c064.htm</td>\n",
       "      <td>2021-03-23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>护理与健康学院召开2021年春季工作会议</td>\n",
       "      <td>30f39cccbda84ecb92013ecfcc410ff6.htm</td>\n",
       "      <td>2021-03-22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>广州南方学院教育实践基地签约挂牌仪式暨2021年良口中学第一期课程开班仪式</td>\n",
       "      <td>7f86c7803e7c4408839f64ed8b1d1140.htm</td>\n",
       "      <td>2021-03-22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>会计学一流专业建设研讨会暨“注协班”签约仪式在我校顺利举行</td>\n",
       "      <td>635fef9673644747890cc90c6dc67b6f.htm</td>\n",
       "      <td>2021-03-18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>护理与健康学院直属党支部举办“传承红色基因，讲好党员故事”故事汇报会</td>\n",
       "      <td>2de35ebbd3574d8f9fb5dd8cc64f5c17.htm</td>\n",
       "      <td>2021-03-17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>坚定信念，逐梦考研 ——会计学院2019级考研动员会顺利举行</td>\n",
       "      <td>1ca0eaebd5754d809aeffe4219312f6b.htm</td>\n",
       "      <td>2021-03-15</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                   标题  \\\n",
       "0            “远离糖尿病，筑起健康防线” 护理与健康学院寒假社会实践调查成果汇报展示圆满结束   \n",
       "1                                     励能计划2021：你选哪一项？   \n",
       "2                党团同行传薪火，红色循迹筑初心——商学院党团同行重走“东江纵队”红色之路   \n",
       "3                      广州南方学院老年与慢病护理研究中心学术沙龙系列第3期圆满结束   \n",
       "4                          凝心聚力 共谱新篇——商学院召开新学期全体教职工大会   \n",
       "5                   青马工程｜“回首峥嵘岁月，领悟红船精神”——商学院百年党史宣讲活动   \n",
       "6              护理与健康学院“教学相长，从教学中成长”暨青年教师专题讲座与交流活动圆满结束   \n",
       "7   党建观摩拓思路，对照标杆“取真经”——我校商学院师生团队赴广东外语外贸大学南国商学院管理学院...   \n",
       "8                     护理与健康学院直属党支部2021年春季入党积极分子培训圆满结束   \n",
       "9                           成长在文传我院举行2021年春季学期全体教职工大会   \n",
       "10                   倾心指导促研学，凝心聚力谋发展——大英中心教学研究座谈会顺利召开   \n",
       "11                               护理与健康学院第37期师生面对面顺利开展   \n",
       "12             凝聚共识谋规划， 师生同心促发展—— 电气与计算机工程学院召开全体教职工大会   \n",
       "13                              护理与健康学院“开卷行之”征文比赛圆满结束   \n",
       "14                  青春心向党，奋进新时代——护理与健康学院院长“思政第一课”顺利开讲   \n",
       "15                               护理与健康学院召开2021年春季工作会议   \n",
       "16              广州南方学院教育实践基地签约挂牌仪式暨2021年良口中学第一期课程开班仪式   \n",
       "17                      会计学一流专业建设研讨会暨“注协班”签约仪式在我校顺利举行   \n",
       "18                 护理与健康学院直属党支部举办“传承红色基因，讲好党员故事”故事汇报会   \n",
       "19                     坚定信念，逐梦考研 ——会计学院2019级考研动员会顺利举行   \n",
       "\n",
       "                                      链接          日期  \n",
       "0   2f3dcc0f4400419e8e42af09fde3c251.htm  2021-03-29  \n",
       "1   8b2414ee7cca45d88c4217dd13f8f8ec.htm  2021-04-02  \n",
       "2   a9523b72a34e4143afa9b38879ecba0c.htm  2021-04-02  \n",
       "3   f8434c9f092348c2a4a3c1ac8727a8fd.htm  2021-04-02  \n",
       "4   d60d33983337463390ef99385afce119.htm  2021-04-01  \n",
       "5   4b0c8e69b5074d28badd20cb55436009.htm  2021-04-01  \n",
       "6   bdda4dfbda944a3eb84612b7045620f4.htm  2021-04-01  \n",
       "7   96e05388e3fa43de9a8f446b083875f8.htm  2021-03-30  \n",
       "8   25dc7cb574284be18a6c9a0640e5aca3.htm  2021-03-30  \n",
       "9   b9777111c2194e7b85143431ab4706a7.htm  2021-03-29  \n",
       "10  c3846031b4c0444a99e0dfd90047c046.htm  2021-03-26  \n",
       "11  5e165fdaee834899891ba5b3eea69bc9.htm  2021-03-26  \n",
       "12  76d9a219517e4a2b8c28135b51f55e3b.htm  2021-03-25  \n",
       "13  bf6e98d6027544809e35f6f8d5ea5c3a.htm  2021-03-24  \n",
       "14  874bf131af7746d888ec1801eb31c064.htm  2021-03-23  \n",
       "15  30f39cccbda84ecb92013ecfcc410ff6.htm  2021-03-22  \n",
       "16  7f86c7803e7c4408839f64ed8b1d1140.htm  2021-03-22  \n",
       "17  635fef9673644747890cc90c6dc67b6f.htm  2021-03-18  \n",
       "18  2de35ebbd3574d8f9fb5dd8cc64f5c17.htm  2021-03-17  \n",
       "19  1ca0eaebd5754d809aeffe4219312f6b.htm  2021-03-15  "
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_two = pd.DataFrame( {\n",
    "         \"标题\": r_two.html.xpath('//div[@class=\"news_title\"]/a/@title'),\n",
    "         \"链接\": r_two.html.xpath('//div[@class=\"news_title\"]/a/@href'),\n",
    "         \"日期\": r_two.html.xpath('//font[@class=\"right-more\"]/text()'),\n",
    "     } )\n",
    "df_two"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "200"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "session = HTMLSession()\n",
    "r_three = session.get( 'https://www.nfu.edu.cn/tzgg/index.htm')\n",
    "# 状态码查询\n",
    "r_three.status_code"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>标题</th>\n",
       "      <th>链接</th>\n",
       "      <th>日期</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>中山大学南方学院关于举办2020年预防艾滋病巡讲活动的通知</td>\n",
       "      <td>f381db0e5b3e4746b310806a81edbaba.htm</td>\n",
       "      <td>2020-12-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>中山大学南方学院关于举办2020～2021学年教职工体育活动的通知</td>\n",
       "      <td>47ba4c0dfb1443f9945ee3e6df61c921.htm</td>\n",
       "      <td>2020-11-25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>学校办公室关于举办2020年秋季学期校长午餐会的通知</td>\n",
       "      <td>66fc5e810c664b919bf192de1833c5d1.htm</td>\n",
       "      <td>2020-11-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>关于国庆中秋假期学生出入校园管理的通知</td>\n",
       "      <td>6e824246669d471ca24b98dfb9538f41.htm</td>\n",
       "      <td>2020-09-25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>校园管理部关于调整班车运行班次的通知</td>\n",
       "      <td>df9afab7eb564161bc1a8198b364e79d.htm</td>\n",
       "      <td>2020-09-15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>中山大学南方学院关于2020年国庆节、中秋节放假安排的通知</td>\n",
       "      <td>b57e28f6cd5a4cb7b1e67376809d99cb.htm</td>\n",
       "      <td>2020-09-11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>中山大学南方学院关于启用电子校园卡的通知</td>\n",
       "      <td>ad7da9ff14494749b7334b768b2e7207.htm</td>\n",
       "      <td>2020-09-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>关于开展“节约粮食从点滴做起，请跟我一起行动” 主题团日活动的通知</td>\n",
       "      <td>54573ec40397435ca49607cef867b18b.htm</td>\n",
       "      <td>2020-08-20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>中山大学南方学院关于成立公共管理学院的通知</td>\n",
       "      <td>e28b2797a45d471b883388659c0d1eb3.htm</td>\n",
       "      <td>2020-08-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>中共中山大学南方学院委员会关于公共管理学系党总支更名的通知</td>\n",
       "      <td>fc277cccd7f440a2bdadcde84c707815.htm</td>\n",
       "      <td>2020-08-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>校园管理部关于2019～2020学年暑假期间校园生活服务安排的通知</td>\n",
       "      <td>f04e18c7e60b437d8c4591851809edb4.htm</td>\n",
       "      <td>2020-07-24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>中山大学南方学院关于公布2020-2021学年校历的通知</td>\n",
       "      <td>4df100c9d8754356a625bd01f70a2d79.htm</td>\n",
       "      <td>2020-07-18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>校园管理部关于2020年端午节假期校园生活服务安排的通知</td>\n",
       "      <td>ed13952ecd4343d99de23d32ea968eb3.htm</td>\n",
       "      <td>2020-06-24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>校园管理部关于2020届毕业生缴纳水费的通知</td>\n",
       "      <td>8eece1bbe3b34e489ebf8afdc9069e0f.htm</td>\n",
       "      <td>2020-06-23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>保卫部关于学校中区食堂南侧校道实行交通管制的通知</td>\n",
       "      <td>59b8a6f87bde4424be1973c6b7196d29.htm</td>\n",
       "      <td>2020-06-14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>中山大学南方学院关于2020年端午节放假安排的通知</td>\n",
       "      <td>72612c183e4c4b67a736a66accfe2dc6.htm</td>\n",
       "      <td>2020-06-11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>关于近期强降水对学校造成地质灾害情况的通报</td>\n",
       "      <td>7ac1ab87177e44f2a9d11a60cc254e64.htm</td>\n",
       "      <td>2020-06-09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>校园管理部关于调整班车运行班次的通知</td>\n",
       "      <td>40ed7e25c7e045ac8220e1af1fa2b981.htm</td>\n",
       "      <td>2020-06-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>关于组织我校学生参加上半年心理健康普查的通知</td>\n",
       "      <td>379e062afbda4f9197a16a364df960de.htm</td>\n",
       "      <td>2020-06-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>教务部关于调整办理学生证明证件等业务的通知</td>\n",
       "      <td>e52c376f9f5b4c5d890c2e3901906642.htm</td>\n",
       "      <td>2020-05-29</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                   标题                                    链接  \\\n",
       "0       中山大学南方学院关于举办2020年预防艾滋病巡讲活动的通知  f381db0e5b3e4746b310806a81edbaba.htm   \n",
       "1   中山大学南方学院关于举办2020～2021学年教职工体育活动的通知  47ba4c0dfb1443f9945ee3e6df61c921.htm   \n",
       "2          学校办公室关于举办2020年秋季学期校长午餐会的通知  66fc5e810c664b919bf192de1833c5d1.htm   \n",
       "3                 关于国庆中秋假期学生出入校园管理的通知  6e824246669d471ca24b98dfb9538f41.htm   \n",
       "4                  校园管理部关于调整班车运行班次的通知  df9afab7eb564161bc1a8198b364e79d.htm   \n",
       "5       中山大学南方学院关于2020年国庆节、中秋节放假安排的通知  b57e28f6cd5a4cb7b1e67376809d99cb.htm   \n",
       "6                中山大学南方学院关于启用电子校园卡的通知  ad7da9ff14494749b7334b768b2e7207.htm   \n",
       "7   关于开展“节约粮食从点滴做起，请跟我一起行动” 主题团日活动的通知  54573ec40397435ca49607cef867b18b.htm   \n",
       "8               中山大学南方学院关于成立公共管理学院的通知  e28b2797a45d471b883388659c0d1eb3.htm   \n",
       "9       中共中山大学南方学院委员会关于公共管理学系党总支更名的通知  fc277cccd7f440a2bdadcde84c707815.htm   \n",
       "10  校园管理部关于2019～2020学年暑假期间校园生活服务安排的通知  f04e18c7e60b437d8c4591851809edb4.htm   \n",
       "11       中山大学南方学院关于公布2020-2021学年校历的通知  4df100c9d8754356a625bd01f70a2d79.htm   \n",
       "12       校园管理部关于2020年端午节假期校园生活服务安排的通知  ed13952ecd4343d99de23d32ea968eb3.htm   \n",
       "13             校园管理部关于2020届毕业生缴纳水费的通知  8eece1bbe3b34e489ebf8afdc9069e0f.htm   \n",
       "14           保卫部关于学校中区食堂南侧校道实行交通管制的通知  59b8a6f87bde4424be1973c6b7196d29.htm   \n",
       "15          中山大学南方学院关于2020年端午节放假安排的通知  72612c183e4c4b67a736a66accfe2dc6.htm   \n",
       "16              关于近期强降水对学校造成地质灾害情况的通报  7ac1ab87177e44f2a9d11a60cc254e64.htm   \n",
       "17                 校园管理部关于调整班车运行班次的通知  40ed7e25c7e045ac8220e1af1fa2b981.htm   \n",
       "18             关于组织我校学生参加上半年心理健康普查的通知  379e062afbda4f9197a16a364df960de.htm   \n",
       "19              教务部关于调整办理学生证明证件等业务的通知  e52c376f9f5b4c5d890c2e3901906642.htm   \n",
       "\n",
       "            日期  \n",
       "0   2020-12-03  \n",
       "1   2020-11-25  \n",
       "2   2020-11-07  \n",
       "3   2020-09-25  \n",
       "4   2020-09-15  \n",
       "5   2020-09-11  \n",
       "6   2020-09-08  \n",
       "7   2020-08-20  \n",
       "8   2020-08-05  \n",
       "9   2020-08-05  \n",
       "10  2020-07-24  \n",
       "11  2020-07-18  \n",
       "12  2020-06-24  \n",
       "13  2020-06-23  \n",
       "14  2020-06-14  \n",
       "15  2020-06-11  \n",
       "16  2020-06-09  \n",
       "17  2020-06-08  \n",
       "18  2020-06-05  \n",
       "19  2020-05-29  "
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_three = pd.DataFrame( {\n",
    "         \"标题\": r_three.html.xpath('//div[@class=\"news_title\"]/a/@title'),\n",
    "         \"链接\": r_three.html.xpath('//div[@class=\"news_title\"]/a/@href'),\n",
    "         \"日期\": r_three.html.xpath('//font[@class=\"right-more\"]/text()'),\n",
    "     } )\n",
    "df_three"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "200"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "session = HTMLSession()\n",
    "r_four = session.get( 'https://www.nfu.edu.cn/ztb/index.htm')\n",
    "# 状态码查询\n",
    "r_four.status_code"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>标题</th>\n",
       "      <th>链接</th>\n",
       "      <th>日期</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>广州南方学院蚊子、苍蝇、蟑螂消杀及白蚁、红火蚁防治项目 招标公告</td>\n",
       "      <td>ea8754261f26419080ae1933f5ae7f2a.htm</td>\n",
       "      <td>2021-04-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>中山大学南方学院数字电路基础实验室、电路与模拟电子实验室设备采购项目招标公告</td>\n",
       "      <td>7226fe9acf3b4757b972599c1c947ffe.htm</td>\n",
       "      <td>2021-03-31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>中山大学南方学院垃圾清运和处理服务项目招标公告</td>\n",
       "      <td>414b2db5e6c04f99be1096effc050fe1.htm</td>\n",
       "      <td>2021-03-17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>中山大学南方学院2021年度维修、改造工程施工项目中标结果公示</td>\n",
       "      <td>60c660848ef44283bcae0b864f06245b.htm</td>\n",
       "      <td>2021-03-11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>中山大学南方学院校舍家电采购项目招标公告</td>\n",
       "      <td>c1f45c4ed6d24523b8015716f1354c69.htm</td>\n",
       "      <td>2021-03-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>中山大学南方学院办公电脑采购项目招标公告</td>\n",
       "      <td>8de22fa69c5a4718a5d3a234157a231a.htm</td>\n",
       "      <td>2021-03-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>中山大学南方学院2021年度维修、改造工程施工项目招标公告</td>\n",
       "      <td>84df006147494c74a06300e42ba5fe0f.htm</td>\n",
       "      <td>2021-01-26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>中山大学南方学院2021年度维修、改造工程施工项目流标公告</td>\n",
       "      <td>5b6a96bc894e4901b9015550f495d48c.htm</td>\n",
       "      <td>2021-01-25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>中山大学南方学院2021年度维修、改造工程施工项目招标开标延期公告</td>\n",
       "      <td>cee6034ea34b4d37af132488e5b08eba.htm</td>\n",
       "      <td>2021-01-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>中山大学南方学院2021年度维修、改造工程施工项目招标公告</td>\n",
       "      <td>2b0efb94d7bc43a69cf7705d8e5eb3fb.htm</td>\n",
       "      <td>2020-12-11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>中山大学南方学院网络技术与媒体研发平台实验室设备采购项目招标公告</td>\n",
       "      <td>4ca38f35a904483aa17f8149b6e74a5f.htm</td>\n",
       "      <td>2020-11-18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>中山大学南方学院计算机组成原理实验箱采购项目招标公告</td>\n",
       "      <td>d9a43543bfc04b249605e362c4d56fde.htm</td>\n",
       "      <td>2020-11-13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>中山大学南方学院2020-2021办公电脑采购项目​招标开标延期公告</td>\n",
       "      <td>a94be158ee2d45629fa34fe777c524aa.htm</td>\n",
       "      <td>2020-09-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>中山大学南方学院2020-2021办公电脑采购项目招标公告</td>\n",
       "      <td>6c02c38297c94f82a0b00e0c465ecf42.htm</td>\n",
       "      <td>2020-09-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>中山大学南方学院容灾自动备份系统采购项目 招标公告</td>\n",
       "      <td>f312609072284e918844133b2e8d17de.htm</td>\n",
       "      <td>2020-08-15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>中山大学南方学院九期教工宿舍家具采购和安装项目中标结果公示</td>\n",
       "      <td>711839de4a50406da99b621c5c60f53a.htm</td>\n",
       "      <td>2020-08-14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>中山大学南方学院嵌入式创新实验室家具采购项目招标开标延期公告</td>\n",
       "      <td>ef39ea1df91b4208859c3d139614b752.htm</td>\n",
       "      <td>2020-07-24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>中山大学南方学院跨境电商平台系统采购项目招标公告</td>\n",
       "      <td>303ff597654847ad9fe7ec28cee402b3.htm</td>\n",
       "      <td>2020-07-24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>中山大学南方学院九期教工宿舍卫浴设施采购和安装项目招标开标延期公告</td>\n",
       "      <td>3c3b1ca74f0b47e1a6f9a6e2434014aa.htm</td>\n",
       "      <td>2020-07-17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>中山大学南方学院九期教工宿舍窗帘采购安装项目招标公告</td>\n",
       "      <td>bb5be88f7b7f424dab2b86c0ae7f7b2c.htm</td>\n",
       "      <td>2020-07-17</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                        标题  \\\n",
       "0         广州南方学院蚊子、苍蝇、蟑螂消杀及白蚁、红火蚁防治项目 招标公告   \n",
       "1   中山大学南方学院数字电路基础实验室、电路与模拟电子实验室设备采购项目招标公告   \n",
       "2                  中山大学南方学院垃圾清运和处理服务项目招标公告   \n",
       "3          中山大学南方学院2021年度维修、改造工程施工项目中标结果公示   \n",
       "4                     中山大学南方学院校舍家电采购项目招标公告   \n",
       "5                     中山大学南方学院办公电脑采购项目招标公告   \n",
       "6            中山大学南方学院2021年度维修、改造工程施工项目招标公告   \n",
       "7            中山大学南方学院2021年度维修、改造工程施工项目流标公告   \n",
       "8        中山大学南方学院2021年度维修、改造工程施工项目招标开标延期公告   \n",
       "9            中山大学南方学院2021年度维修、改造工程施工项目招标公告   \n",
       "10        中山大学南方学院网络技术与媒体研发平台实验室设备采购项目招标公告   \n",
       "11              中山大学南方学院计算机组成原理实验箱采购项目招标公告   \n",
       "12      中山大学南方学院2020-2021办公电脑采购项目​招标开标延期公告   \n",
       "13           中山大学南方学院2020-2021办公电脑采购项目招标公告   \n",
       "14               中山大学南方学院容灾自动备份系统采购项目 招标公告   \n",
       "15           中山大学南方学院九期教工宿舍家具采购和安装项目中标结果公示   \n",
       "16          中山大学南方学院嵌入式创新实验室家具采购项目招标开标延期公告   \n",
       "17                中山大学南方学院跨境电商平台系统采购项目招标公告   \n",
       "18       中山大学南方学院九期教工宿舍卫浴设施采购和安装项目招标开标延期公告   \n",
       "19              中山大学南方学院九期教工宿舍窗帘采购安装项目招标公告   \n",
       "\n",
       "                                      链接          日期  \n",
       "0   ea8754261f26419080ae1933f5ae7f2a.htm  2021-04-02  \n",
       "1   7226fe9acf3b4757b972599c1c947ffe.htm  2021-03-31  \n",
       "2   414b2db5e6c04f99be1096effc050fe1.htm  2021-03-17  \n",
       "3   60c660848ef44283bcae0b864f06245b.htm  2021-03-11  \n",
       "4   c1f45c4ed6d24523b8015716f1354c69.htm  2021-03-05  \n",
       "5   8de22fa69c5a4718a5d3a234157a231a.htm  2021-03-03  \n",
       "6   84df006147494c74a06300e42ba5fe0f.htm  2021-01-26  \n",
       "7   5b6a96bc894e4901b9015550f495d48c.htm  2021-01-25  \n",
       "8   cee6034ea34b4d37af132488e5b08eba.htm  2021-01-05  \n",
       "9   2b0efb94d7bc43a69cf7705d8e5eb3fb.htm  2020-12-11  \n",
       "10  4ca38f35a904483aa17f8149b6e74a5f.htm  2020-11-18  \n",
       "11  d9a43543bfc04b249605e362c4d56fde.htm  2020-11-13  \n",
       "12  a94be158ee2d45629fa34fe777c524aa.htm  2020-09-03  \n",
       "13  6c02c38297c94f82a0b00e0c465ecf42.htm  2020-09-01  \n",
       "14  f312609072284e918844133b2e8d17de.htm  2020-08-15  \n",
       "15  711839de4a50406da99b621c5c60f53a.htm  2020-08-14  \n",
       "16  ef39ea1df91b4208859c3d139614b752.htm  2020-07-24  \n",
       "17  303ff597654847ad9fe7ec28cee402b3.htm  2020-07-24  \n",
       "18  3c3b1ca74f0b47e1a6f9a6e2434014aa.htm  2020-07-17  \n",
       "19  bb5be88f7b7f424dab2b86c0ae7f7b2c.htm  2020-07-17  "
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_four = pd.DataFrame( {\n",
    "         \"标题\": r_four.html.xpath('//div[@class=\"news_title\"]/a/@title'),\n",
    "         \"链接\": r_four.html.xpath('//div[@class=\"news_title\"]/a/@href'),\n",
    "         \"日期\": r_four.html.xpath('//font[@class=\"right-more\"]/text()'),\n",
    "     } )\n",
    "df_four"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "200"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "session = HTMLSession()\n",
    "r_five = session.get( 'https://www.nfu.edu.cn/ztb/index.htm')\n",
    "# 状态码查询\n",
    "r_five.status_code"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>标题</th>\n",
       "      <th>链接</th>\n",
       "      <th>日期</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>广州南方学院蚊子、苍蝇、蟑螂消杀及白蚁、红火蚁防治项目 招标公告</td>\n",
       "      <td>ea8754261f26419080ae1933f5ae7f2a.htm</td>\n",
       "      <td>2021-04-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>中山大学南方学院数字电路基础实验室、电路与模拟电子实验室设备采购项目招标公告</td>\n",
       "      <td>7226fe9acf3b4757b972599c1c947ffe.htm</td>\n",
       "      <td>2021-03-31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>中山大学南方学院垃圾清运和处理服务项目招标公告</td>\n",
       "      <td>414b2db5e6c04f99be1096effc050fe1.htm</td>\n",
       "      <td>2021-03-17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>中山大学南方学院2021年度维修、改造工程施工项目中标结果公示</td>\n",
       "      <td>60c660848ef44283bcae0b864f06245b.htm</td>\n",
       "      <td>2021-03-11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>中山大学南方学院校舍家电采购项目招标公告</td>\n",
       "      <td>c1f45c4ed6d24523b8015716f1354c69.htm</td>\n",
       "      <td>2021-03-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>中山大学南方学院办公电脑采购项目招标公告</td>\n",
       "      <td>8de22fa69c5a4718a5d3a234157a231a.htm</td>\n",
       "      <td>2021-03-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>中山大学南方学院2021年度维修、改造工程施工项目招标公告</td>\n",
       "      <td>84df006147494c74a06300e42ba5fe0f.htm</td>\n",
       "      <td>2021-01-26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>中山大学南方学院2021年度维修、改造工程施工项目流标公告</td>\n",
       "      <td>5b6a96bc894e4901b9015550f495d48c.htm</td>\n",
       "      <td>2021-01-25</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>中山大学南方学院2021年度维修、改造工程施工项目招标开标延期公告</td>\n",
       "      <td>cee6034ea34b4d37af132488e5b08eba.htm</td>\n",
       "      <td>2021-01-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>中山大学南方学院2021年度维修、改造工程施工项目招标公告</td>\n",
       "      <td>2b0efb94d7bc43a69cf7705d8e5eb3fb.htm</td>\n",
       "      <td>2020-12-11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>中山大学南方学院网络技术与媒体研发平台实验室设备采购项目招标公告</td>\n",
       "      <td>4ca38f35a904483aa17f8149b6e74a5f.htm</td>\n",
       "      <td>2020-11-18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>中山大学南方学院计算机组成原理实验箱采购项目招标公告</td>\n",
       "      <td>d9a43543bfc04b249605e362c4d56fde.htm</td>\n",
       "      <td>2020-11-13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>中山大学南方学院2020-2021办公电脑采购项目​招标开标延期公告</td>\n",
       "      <td>a94be158ee2d45629fa34fe777c524aa.htm</td>\n",
       "      <td>2020-09-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>中山大学南方学院2020-2021办公电脑采购项目招标公告</td>\n",
       "      <td>6c02c38297c94f82a0b00e0c465ecf42.htm</td>\n",
       "      <td>2020-09-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>中山大学南方学院容灾自动备份系统采购项目 招标公告</td>\n",
       "      <td>f312609072284e918844133b2e8d17de.htm</td>\n",
       "      <td>2020-08-15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>中山大学南方学院九期教工宿舍家具采购和安装项目中标结果公示</td>\n",
       "      <td>711839de4a50406da99b621c5c60f53a.htm</td>\n",
       "      <td>2020-08-14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>中山大学南方学院嵌入式创新实验室家具采购项目招标开标延期公告</td>\n",
       "      <td>ef39ea1df91b4208859c3d139614b752.htm</td>\n",
       "      <td>2020-07-24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>中山大学南方学院跨境电商平台系统采购项目招标公告</td>\n",
       "      <td>303ff597654847ad9fe7ec28cee402b3.htm</td>\n",
       "      <td>2020-07-24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>中山大学南方学院九期教工宿舍卫浴设施采购和安装项目招标开标延期公告</td>\n",
       "      <td>3c3b1ca74f0b47e1a6f9a6e2434014aa.htm</td>\n",
       "      <td>2020-07-17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>中山大学南方学院九期教工宿舍窗帘采购安装项目招标公告</td>\n",
       "      <td>bb5be88f7b7f424dab2b86c0ae7f7b2c.htm</td>\n",
       "      <td>2020-07-17</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                        标题  \\\n",
       "0         广州南方学院蚊子、苍蝇、蟑螂消杀及白蚁、红火蚁防治项目 招标公告   \n",
       "1   中山大学南方学院数字电路基础实验室、电路与模拟电子实验室设备采购项目招标公告   \n",
       "2                  中山大学南方学院垃圾清运和处理服务项目招标公告   \n",
       "3          中山大学南方学院2021年度维修、改造工程施工项目中标结果公示   \n",
       "4                     中山大学南方学院校舍家电采购项目招标公告   \n",
       "5                     中山大学南方学院办公电脑采购项目招标公告   \n",
       "6            中山大学南方学院2021年度维修、改造工程施工项目招标公告   \n",
       "7            中山大学南方学院2021年度维修、改造工程施工项目流标公告   \n",
       "8        中山大学南方学院2021年度维修、改造工程施工项目招标开标延期公告   \n",
       "9            中山大学南方学院2021年度维修、改造工程施工项目招标公告   \n",
       "10        中山大学南方学院网络技术与媒体研发平台实验室设备采购项目招标公告   \n",
       "11              中山大学南方学院计算机组成原理实验箱采购项目招标公告   \n",
       "12      中山大学南方学院2020-2021办公电脑采购项目​招标开标延期公告   \n",
       "13           中山大学南方学院2020-2021办公电脑采购项目招标公告   \n",
       "14               中山大学南方学院容灾自动备份系统采购项目 招标公告   \n",
       "15           中山大学南方学院九期教工宿舍家具采购和安装项目中标结果公示   \n",
       "16          中山大学南方学院嵌入式创新实验室家具采购项目招标开标延期公告   \n",
       "17                中山大学南方学院跨境电商平台系统采购项目招标公告   \n",
       "18       中山大学南方学院九期教工宿舍卫浴设施采购和安装项目招标开标延期公告   \n",
       "19              中山大学南方学院九期教工宿舍窗帘采购安装项目招标公告   \n",
       "\n",
       "                                      链接          日期  \n",
       "0   ea8754261f26419080ae1933f5ae7f2a.htm  2021-04-02  \n",
       "1   7226fe9acf3b4757b972599c1c947ffe.htm  2021-03-31  \n",
       "2   414b2db5e6c04f99be1096effc050fe1.htm  2021-03-17  \n",
       "3   60c660848ef44283bcae0b864f06245b.htm  2021-03-11  \n",
       "4   c1f45c4ed6d24523b8015716f1354c69.htm  2021-03-05  \n",
       "5   8de22fa69c5a4718a5d3a234157a231a.htm  2021-03-03  \n",
       "6   84df006147494c74a06300e42ba5fe0f.htm  2021-01-26  \n",
       "7   5b6a96bc894e4901b9015550f495d48c.htm  2021-01-25  \n",
       "8   cee6034ea34b4d37af132488e5b08eba.htm  2021-01-05  \n",
       "9   2b0efb94d7bc43a69cf7705d8e5eb3fb.htm  2020-12-11  \n",
       "10  4ca38f35a904483aa17f8149b6e74a5f.htm  2020-11-18  \n",
       "11  d9a43543bfc04b249605e362c4d56fde.htm  2020-11-13  \n",
       "12  a94be158ee2d45629fa34fe777c524aa.htm  2020-09-03  \n",
       "13  6c02c38297c94f82a0b00e0c465ecf42.htm  2020-09-01  \n",
       "14  f312609072284e918844133b2e8d17de.htm  2020-08-15  \n",
       "15  711839de4a50406da99b621c5c60f53a.htm  2020-08-14  \n",
       "16  ef39ea1df91b4208859c3d139614b752.htm  2020-07-24  \n",
       "17  303ff597654847ad9fe7ec28cee402b3.htm  2020-07-24  \n",
       "18  3c3b1ca74f0b47e1a6f9a6e2434014aa.htm  2020-07-17  \n",
       "19  bb5be88f7b7f424dab2b86c0ae7f7b2c.htm  2020-07-17  "
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_five = pd.DataFrame( {\n",
    "         \"标题\": r_five.html.xpath('//div[@class=\"news_title\"]/a/@title'),\n",
    "         \"链接\": r_five.html.xpath('//div[@class=\"news_title\"]/a/@href'),\n",
    "         \"日期\": r_five.html.xpath('//font[@class=\"right-more\"]/text()'),\n",
    "     } )\n",
    "df_five"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_one.to_excel(writer, sheet_name=\"学校要闻\")\n",
    "df_two.to_excel(writer, sheet_name=\"校园动态\")\n",
    "df_three.to_excel(writer, sheet_name=\"通知公告\")\n",
    "df_four.to_excel(writer, sheet_name=\"招投标\")\n",
    "df_five.to_excel(writer, sheet_name=\"高教动态\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "writer.save()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
